package com.atguigu.flink.chapter5.transform;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2020/12/19 14:56
 */
public class Flink06_Transform_Shuffle {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(2);
        DataStreamSource<Integer> stream1 = env.fromElements(10, 20, 30, 40, 50);

        DataStream<Integer> stream2 = stream1.shuffle();

        stream2.print("s2");
//        stream1.print("s1");

        env.execute();
    }
}
/*
这些function 都有一个Rich
 */
